<?php
namespace app\home\controller;
use \think\Db;


class Evaluation extends \think\Controller
{
    public function index(){
        //鉴定评估类别
        $category = Db::table('baode_article_category')->where('title','鉴定评估')->find();
        $categoryArr = Db::table('baode_article_category')->where('pid',intval($category['id']))->select();
        input('category_id') and $category_id = input('category_id') or $category_id = $categoryArr[0]['id'];
        
        //鉴定评估列表
        $data = Db::table('baode_expert')->order('id desc')->paginate(4);
        $listArr = $data->items();
        $pages = $data->render();
        return $this->allFetch(get_defined_vars());
    }
    
    public function info(){
        //鉴定评估类别
        $category = Db::table('baode_article_category')->where('title','鉴定评估')->find();
        $categoryArr = Db::table('baode_article_category')->where('pid',intval($category['id']))->select();
        input('category_id') and $category_id = input('category_id') or $category_id = $categoryArr[0]['id'];
    	//专家详情
        input('eid') and $eid = input('eid');
        $eInfo = Db::table('baode_expert')->where('id',intval($eid))->find();
        
        //var_dump($eInfo);die;
    	return $this->allFetch(get_defined_vars());
    }
}
